#ifndef ERROR_H
#define ERROR_H

#include <QObject>
#include <QDebug>
#include <QTextStream>
#include <iostream>
#include <QMessageBox>

#define LOG_DIR "log/"
#define LOG_FILE "errors_%1.log"
#define FILE_NAME_DATE_FORMAT   "dd_MM_yy__hh_mm"

class Error : public QObject
{
    Q_OBJECT
public:

    ~Error();

    static Error* getInstance();
    static void msgOut(QtMsgType type,const char* msg);

    QTextStream &getStream();
signals:
    
public slots:
private:
    explicit Error(QObject *parent = 0);
    static Error* errorInstance;            //singleton
    QTextStream *stream;

    void init();
    
};

#endif // ERROR_H
